<template>
  <div
    class="btn"
    :class="{
      success: type == 'success',
      danger: type == 'danger',
      primary: type == 'primary',
      warning: type == 'warning',
    }"
    @click="handlerclick"
  >
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: {
    type: {
      type: String,
    },
  },
  methods: {
    handlerclick(e) {
      this.$emit("click", e);
    },
  },
};
</script>

<style lang="less" scoped>
.btn {
  width: 318 * 100vw/360;
  height: 50px;
  background-color: gray;
  color: #fff;
  border-radius: 25px;
  line-height: 50px;
  text-align: center;
  // font-weight: bold;
  font-size: 20px;
  margin: 0 auto;
}
.danger {
  background-color: #ca0100;
}
.primary {
  background-color: rgb(25, 115, 233);
}
.success {
  background-color: rgb(70, 158, 12);
}
.warning {
  background-color: #eb6112;
}
</style>